# 做接口测试的库--requests
import requests
"""
发起一个请求：
接口地址
端口号
IP/域名
请求方式
请求头参数
请求体参数
"""
# 发起登录请求
response = requests.post(url="http://8.148.229.201:8899/adminapi/login",json={"account":"admin","pwd":"123456","key":"68998c008b4ff","captchaType":"blockPuzzle","captchaVerification":""})
# 接受响应
# print(response.json())      # 打印响应体是字典格式
# 提取token
# token = response.json()['data']['token']
# print(token)
# print(response.json()['msg'])
# print(response.json()['data']['menus'][0]['id'])

# 打印响应状态码
# print(response.status_code)

# 打印响应体是文本格式
# print(response.text)

# 打印响应体是二进制格式：前面带个小b
# print(response.content)

# 打印接口请求url
# print(response.url)



